Left Termination of the query pattern ways_in_3(g, g, a) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PredefinedPredicateTransformerProof

Clauses:

nat(0).
nat(s(X)) :- nat(X).
plus(0, X, X) :- nat(X).
plus(s(X), Y, s(Z)) :- plus(X, Y, Z).
ways(0, _, s(0)).
ways(_, [], 0).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(_)), ','(plus(s(C), NewAmount, Amount), ','(ways(Amount, Coins, N1), ','(ways(NewAmount, .(s(C), Coins), N2), plus(N1, N2, N))))).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(_)), ','(plus(Amount, s(_), s(C)), ways(Amount, Coins, N))).

Queries:

ways(g,g,a).

Added definitions of predefined predicates.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
Prolog
      ↳ PrologToPiTRSProof

Clauses:

nat(0).
nat(s(X)) :- nat(X).
plus(0, X, X) :- nat(X).
plus(s(X), Y, s(Z)) :- plus(X, Y, Z).
ways(0, X, s(0)).
ways(X, [], 0).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(X)), ','(plus(s(C), NewAmount, Amount), ','(ways(Amount, Coins, N1), ','(ways(NewAmount, .(s(C), Coins), N2), plus(N1, N2, N))))).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(X)), ','(plus(Amount, s(X1), s(C)), ways(Amount, Coins, N))).
=(X, X).

Queries:

ways(g,g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins), N) → U4(Amount, C, Coins, N, =_in(Amount, s(X)))
=_in(X, X) → =_out(X, X)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U9(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
plus_in(s(X), Y, s(Z)) → U3(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → U2(X, nat_in(X))
nat_in(s(X)) → U1(X, nat_in(X))
nat_in(0) → nat_out(0)
U1(X, nat_out(X)) → nat_out(s(X))
U2(X, nat_out(X)) → plus_out(0, X, X)
U3(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, N, ways_in(Amount, Coins, N))
ways_in(X, [], 0) → ways_out(X, [], 0)
ways_in(0, X, s(0)) → ways_out(0, X, s(0))
U10(Amount, C, Coins, N, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U5(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U5(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U6(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U7(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, N, plus_in(N1, N2, N))
U8(Amount, C, Coins, N, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in(x1, x2, x3)  =  ways_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x3, x5)
=_in(x1, x2)  =  =_in(x1)
=_out(x1, x2)  =  =_out(x1, x2)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x1, x2, x3, x6)
plus_in(x1, x2, x3)  =  plus_in(x1)
U3(x1, x2, x3, x4)  =  U3(x1, x4)
0  =  0
U2(x1, x2)  =  U2(x2)
nat_in(x1)  =  nat_in
U1(x1, x2)  =  U1(x2)
nat_out(x1)  =  nat_out(x1)
plus_out(x1, x2, x3)  =  plus_out(x1, x2, x3)
U10(x1, x2, x3, x4, x5)  =  U10(x1, x2, x3, x5)
[]  =  []
ways_out(x1, x2, x3)  =  ways_out(x1, x2, x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
U6(x1, x2, x3, x4, x5, x6, x7)  =  U6(x1, x2, x3, x6, x7)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x2, x3, x7, x8)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x2, x3, x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
PiTRS
          ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins), N) → U4(Amount, C, Coins, N, =_in(Amount, s(X)))
=_in(X, X) → =_out(X, X)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U9(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
plus_in(s(X), Y, s(Z)) → U3(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → U2(X, nat_in(X))
nat_in(s(X)) → U1(X, nat_in(X))
nat_in(0) → nat_out(0)
U1(X, nat_out(X)) → nat_out(s(X))
U2(X, nat_out(X)) → plus_out(0, X, X)
U3(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, N, ways_in(Amount, Coins, N))
ways_in(X, [], 0) → ways_out(X, [], 0)
ways_in(0, X, s(0)) → ways_out(0, X, s(0))
U10(Amount, C, Coins, N, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U5(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U5(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U6(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U7(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, N, plus_in(N1, N2, N))
U8(Amount, C, Coins, N, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in(x1, x2, x3)  =  ways_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x3, x5)
=_in(x1, x2)  =  =_in(x1)
=_out(x1, x2)  =  =_out(x1, x2)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x1, x2, x3, x6)
plus_in(x1, x2, x3)  =  plus_in(x1)
U3(x1, x2, x3, x4)  =  U3(x1, x4)
0  =  0
U2(x1, x2)  =  U2(x2)
nat_in(x1)  =  nat_in
U1(x1, x2)  =  U1(x2)
nat_out(x1)  =  nat_out(x1)
plus_out(x1, x2, x3)  =  plus_out(x1, x2, x3)
U10(x1, x2, x3, x4, x5)  =  U10(x1, x2, x3, x5)
[]  =  []
ways_out(x1, x2, x3)  =  ways_out(x1, x2, x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
U6(x1, x2, x3, x4, x5, x6, x7)  =  U6(x1, x2, x3, x6, x7)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x2, x3, x7, x8)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x2, x3, x5)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

WAYS_IN(Amount, .(s(C), Coins), N) → U41(Amount, C, Coins, N, =_in(Amount, s(X)))
WAYS_IN(Amount, .(s(C), Coins), N) → =_IN(Amount, s(X))
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → U91(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → PLUS_IN(Amount, s(X1), s(C))
PLUS_IN(s(X), Y, s(Z)) → U31(X, Y, Z, plus_in(X, Y, Z))
PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)
PLUS_IN(0, X, X) → U21(X, nat_in(X))
PLUS_IN(0, X, X) → NAT_IN(X)
NAT_IN(s(X)) → U11(X, nat_in(X))
NAT_IN(s(X)) → NAT_IN(X)
U91(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U101(Amount, C, Coins, N, ways_in(Amount, Coins, N))
U91(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins, N)
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → U51(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → PLUS_IN(s(C), NewAmount, Amount)
U51(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U51(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins, N1)
U61(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U71(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U61(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins), N2)
U71(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U81(Amount, C, Coins, N, plus_in(N1, N2, N))
U71(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → PLUS_IN(N1, N2, N)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins), N) → U4(Amount, C, Coins, N, =_in(Amount, s(X)))
=_in(X, X) → =_out(X, X)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U9(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
plus_in(s(X), Y, s(Z)) → U3(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → U2(X, nat_in(X))
nat_in(s(X)) → U1(X, nat_in(X))
nat_in(0) → nat_out(0)
U1(X, nat_out(X)) → nat_out(s(X))
U2(X, nat_out(X)) → plus_out(0, X, X)
U3(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, N, ways_in(Amount, Coins, N))
ways_in(X, [], 0) → ways_out(X, [], 0)
ways_in(0, X, s(0)) → ways_out(0, X, s(0))
U10(Amount, C, Coins, N, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U5(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U5(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U6(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U7(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, N, plus_in(N1, N2, N))
U8(Amount, C, Coins, N, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in(x1, x2, x3)  =  ways_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x3, x5)
=_in(x1, x2)  =  =_in(x1)
=_out(x1, x2)  =  =_out(x1, x2)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x1, x2, x3, x6)
plus_in(x1, x2, x3)  =  plus_in(x1)
U3(x1, x2, x3, x4)  =  U3(x1, x4)
0  =  0
U2(x1, x2)  =  U2(x2)
nat_in(x1)  =  nat_in
U1(x1, x2)  =  U1(x2)
nat_out(x1)  =  nat_out(x1)
plus_out(x1, x2, x3)  =  plus_out(x1, x2, x3)
U10(x1, x2, x3, x4, x5)  =  U10(x1, x2, x3, x5)
[]  =  []
ways_out(x1, x2, x3)  =  ways_out(x1, x2, x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
U6(x1, x2, x3, x4, x5, x6, x7)  =  U6(x1, x2, x3, x6, x7)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x2, x3, x7, x8)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x2, x3, x5)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x1, x2, x3, x6)
U71(x1, x2, x3, x4, x5, x6, x7, x8)  =  U71(x1, x2, x3, x7, x8)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1)
U21(x1, x2)  =  U21(x2)
U61(x1, x2, x3, x4, x5, x6, x7)  =  U61(x1, x2, x3, x6, x7)
=_IN(x1, x2)  =  =_IN(x1)
U101(x1, x2, x3, x4, x5)  =  U101(x1, x2, x3, x5)
U31(x1, x2, x3, x4)  =  U31(x1, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x1, x2, x3, x5)
U91(x1, x2, x3, x4, x5, x6)  =  U91(x1, x2, x3, x6)
U11(x1, x2)  =  U11(x2)
U81(x1, x2, x3, x4, x5)  =  U81(x1, x2, x3, x5)
WAYS_IN(x1, x2, x3)  =  WAYS_IN(x1, x2)
NAT_IN(x1)  =  NAT_IN

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
PiDP
              ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

WAYS_IN(Amount, .(s(C), Coins), N) → U41(Amount, C, Coins, N, =_in(Amount, s(X)))
WAYS_IN(Amount, .(s(C), Coins), N) → =_IN(Amount, s(X))
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → U91(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → PLUS_IN(Amount, s(X1), s(C))
PLUS_IN(s(X), Y, s(Z)) → U31(X, Y, Z, plus_in(X, Y, Z))
PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)
PLUS_IN(0, X, X) → U21(X, nat_in(X))
PLUS_IN(0, X, X) → NAT_IN(X)
NAT_IN(s(X)) → U11(X, nat_in(X))
NAT_IN(s(X)) → NAT_IN(X)
U91(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U101(Amount, C, Coins, N, ways_in(Amount, Coins, N))
U91(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins, N)
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → U51(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → PLUS_IN(s(C), NewAmount, Amount)
U51(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U51(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins, N1)
U61(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U71(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U61(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins), N2)
U71(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U81(Amount, C, Coins, N, plus_in(N1, N2, N))
U71(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → PLUS_IN(N1, N2, N)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins), N) → U4(Amount, C, Coins, N, =_in(Amount, s(X)))
=_in(X, X) → =_out(X, X)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U9(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
plus_in(s(X), Y, s(Z)) → U3(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → U2(X, nat_in(X))
nat_in(s(X)) → U1(X, nat_in(X))
nat_in(0) → nat_out(0)
U1(X, nat_out(X)) → nat_out(s(X))
U2(X, nat_out(X)) → plus_out(0, X, X)
U3(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, N, ways_in(Amount, Coins, N))
ways_in(X, [], 0) → ways_out(X, [], 0)
ways_in(0, X, s(0)) → ways_out(0, X, s(0))
U10(Amount, C, Coins, N, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U5(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U5(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U6(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U7(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, N, plus_in(N1, N2, N))
U8(Amount, C, Coins, N, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in(x1, x2, x3)  =  ways_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x3, x5)
=_in(x1, x2)  =  =_in(x1)
=_out(x1, x2)  =  =_out(x1, x2)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x1, x2, x3, x6)
plus_in(x1, x2, x3)  =  plus_in(x1)
U3(x1, x2, x3, x4)  =  U3(x1, x4)
0  =  0
U2(x1, x2)  =  U2(x2)
nat_in(x1)  =  nat_in
U1(x1, x2)  =  U1(x2)
nat_out(x1)  =  nat_out(x1)
plus_out(x1, x2, x3)  =  plus_out(x1, x2, x3)
U10(x1, x2, x3, x4, x5)  =  U10(x1, x2, x3, x5)
[]  =  []
ways_out(x1, x2, x3)  =  ways_out(x1, x2, x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
U6(x1, x2, x3, x4, x5, x6, x7)  =  U6(x1, x2, x3, x6, x7)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x2, x3, x7, x8)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x2, x3, x5)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x1, x2, x3, x6)
U71(x1, x2, x3, x4, x5, x6, x7, x8)  =  U71(x1, x2, x3, x7, x8)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1)
U21(x1, x2)  =  U21(x2)
U61(x1, x2, x3, x4, x5, x6, x7)  =  U61(x1, x2, x3, x6, x7)
=_IN(x1, x2)  =  =_IN(x1)
U101(x1, x2, x3, x4, x5)  =  U101(x1, x2, x3, x5)
U31(x1, x2, x3, x4)  =  U31(x1, x4)
U41(x1, x2, x3, x4, x5)  =  U41(x1, x2, x3, x5)
U91(x1, x2, x3, x4, x5, x6)  =  U91(x1, x2, x3, x6)
U11(x1, x2)  =  U11(x2)
U81(x1, x2, x3, x4, x5)  =  U81(x1, x2, x3, x5)
WAYS_IN(x1, x2, x3)  =  WAYS_IN(x1, x2)
NAT_IN(x1)  =  NAT_IN

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 11 less nodes.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

NAT_IN(s(X)) → NAT_IN(X)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins), N) → U4(Amount, C, Coins, N, =_in(Amount, s(X)))
=_in(X, X) → =_out(X, X)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U9(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
plus_in(s(X), Y, s(Z)) → U3(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → U2(X, nat_in(X))
nat_in(s(X)) → U1(X, nat_in(X))
nat_in(0) → nat_out(0)
U1(X, nat_out(X)) → nat_out(s(X))
U2(X, nat_out(X)) → plus_out(0, X, X)
U3(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, N, ways_in(Amount, Coins, N))
ways_in(X, [], 0) → ways_out(X, [], 0)
ways_in(0, X, s(0)) → ways_out(0, X, s(0))
U10(Amount, C, Coins, N, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U5(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U5(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U6(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U7(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, N, plus_in(N1, N2, N))
U8(Amount, C, Coins, N, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in(x1, x2, x3)  =  ways_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x3, x5)
=_in(x1, x2)  =  =_in(x1)
=_out(x1, x2)  =  =_out(x1, x2)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x1, x2, x3, x6)
plus_in(x1, x2, x3)  =  plus_in(x1)
U3(x1, x2, x3, x4)  =  U3(x1, x4)
0  =  0
U2(x1, x2)  =  U2(x2)
nat_in(x1)  =  nat_in
U1(x1, x2)  =  U1(x2)
nat_out(x1)  =  nat_out(x1)
plus_out(x1, x2, x3)  =  plus_out(x1, x2, x3)
U10(x1, x2, x3, x4, x5)  =  U10(x1, x2, x3, x5)
[]  =  []
ways_out(x1, x2, x3)  =  ways_out(x1, x2, x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
U6(x1, x2, x3, x4, x5, x6, x7)  =  U6(x1, x2, x3, x6, x7)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x2, x3, x7, x8)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x2, x3, x5)
NAT_IN(x1)  =  NAT_IN

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

NAT_IN(s(X)) → NAT_IN(X)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
NAT_IN(x1)  =  NAT_IN

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ NonTerminationProof
                  ↳ PiDP
                  ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

NAT_INNAT_IN

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

NAT_INNAT_IN

The TRS R consists of the following rules:none


s = NAT_IN evaluates to t =NAT_IN

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from NAT_IN to NAT_IN.





↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins), N) → U4(Amount, C, Coins, N, =_in(Amount, s(X)))
=_in(X, X) → =_out(X, X)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U9(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
plus_in(s(X), Y, s(Z)) → U3(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → U2(X, nat_in(X))
nat_in(s(X)) → U1(X, nat_in(X))
nat_in(0) → nat_out(0)
U1(X, nat_out(X)) → nat_out(s(X))
U2(X, nat_out(X)) → plus_out(0, X, X)
U3(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, N, ways_in(Amount, Coins, N))
ways_in(X, [], 0) → ways_out(X, [], 0)
ways_in(0, X, s(0)) → ways_out(0, X, s(0))
U10(Amount, C, Coins, N, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U5(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U5(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U6(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U7(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, N, plus_in(N1, N2, N))
U8(Amount, C, Coins, N, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in(x1, x2, x3)  =  ways_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x3, x5)
=_in(x1, x2)  =  =_in(x1)
=_out(x1, x2)  =  =_out(x1, x2)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x1, x2, x3, x6)
plus_in(x1, x2, x3)  =  plus_in(x1)
U3(x1, x2, x3, x4)  =  U3(x1, x4)
0  =  0
U2(x1, x2)  =  U2(x2)
nat_in(x1)  =  nat_in
U1(x1, x2)  =  U1(x2)
nat_out(x1)  =  nat_out(x1)
plus_out(x1, x2, x3)  =  plus_out(x1, x2, x3)
U10(x1, x2, x3, x4, x5)  =  U10(x1, x2, x3, x5)
[]  =  []
ways_out(x1, x2, x3)  =  ways_out(x1, x2, x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
U6(x1, x2, x3, x4, x5, x6, x7)  =  U6(x1, x2, x3, x6, x7)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x2, x3, x7, x8)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x2, x3, x5)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

PLUS_IN(s(X)) → PLUS_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U91(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins, N)
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → U91(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
U51(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
WAYS_IN(Amount, .(s(C), Coins), N) → U41(Amount, C, Coins, N, =_in(Amount, s(X)))
U51(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins, N1)
U41(Amount, C, Coins, N, =_out(Amount, s(X))) → U51(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U61(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins), N2)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins), N) → U4(Amount, C, Coins, N, =_in(Amount, s(X)))
=_in(X, X) → =_out(X, X)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U9(Amount, C, Coins, N, X, plus_in(Amount, s(X1), s(C)))
plus_in(s(X), Y, s(Z)) → U3(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → U2(X, nat_in(X))
nat_in(s(X)) → U1(X, nat_in(X))
nat_in(0) → nat_out(0)
U1(X, nat_out(X)) → nat_out(s(X))
U2(X, nat_out(X)) → plus_out(0, X, X)
U3(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, N, X, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, N, ways_in(Amount, Coins, N))
ways_in(X, [], 0) → ways_out(X, [], 0)
ways_in(0, X, s(0)) → ways_out(0, X, s(0))
U10(Amount, C, Coins, N, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, N, =_out(Amount, s(X))) → U5(Amount, C, Coins, N, X, plus_in(s(C), NewAmount, Amount))
U5(Amount, C, Coins, N, X, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, N, X, NewAmount, ways_in(Amount, Coins, N1))
U6(Amount, C, Coins, N, X, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N, X, NewAmount, N1, ways_in(NewAmount, .(s(C), Coins), N2))
U7(Amount, C, Coins, N, X, NewAmount, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, N, plus_in(N1, N2, N))
U8(Amount, C, Coins, N, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in(x1, x2, x3)  =  ways_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4(x1, x2, x3, x4, x5)  =  U4(x1, x2, x3, x5)
=_in(x1, x2)  =  =_in(x1)
=_out(x1, x2)  =  =_out(x1, x2)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x1, x2, x3, x6)
plus_in(x1, x2, x3)  =  plus_in(x1)
U3(x1, x2, x3, x4)  =  U3(x1, x4)
0  =  0
U2(x1, x2)  =  U2(x2)
nat_in(x1)  =  nat_in
U1(x1, x2)  =  U1(x2)
nat_out(x1)  =  nat_out(x1)
plus_out(x1, x2, x3)  =  plus_out(x1, x2, x3)
U10(x1, x2, x3, x4, x5)  =  U10(x1, x2, x3, x5)
[]  =  []
ways_out(x1, x2, x3)  =  ways_out(x1, x2, x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
U6(x1, x2, x3, x4, x5, x6, x7)  =  U6(x1, x2, x3, x6, x7)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x2, x3, x7, x8)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x2, x3, x5)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x1, x2, x3, x6)
U61(x1, x2, x3, x4, x5, x6, x7)  =  U61(x1, x2, x3, x6, x7)
U41(x1, x2, x3, x4, x5)  =  U41(x1, x2, x3, x5)
U91(x1, x2, x3, x4, x5, x6)  =  U91(x1, x2, x3, x6)
WAYS_IN(x1, x2, x3)  =  WAYS_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Rewriting

Q DP problem:
The TRS P consists of the following rules:

U91(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins)
U61(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins))
WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_in(Amount))
U41(Amount, C, Coins, =_out(Amount, s(X))) → U91(Amount, C, Coins, plus_in(Amount))
U41(Amount, C, Coins, =_out(Amount, s(X))) → U51(Amount, C, Coins, plus_in(s(C)))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins)) → U4(Amount, C, Coins, =_in(Amount))
=_in(X) → =_out(X, X)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U9(Amount, C, Coins, plus_in(Amount))
plus_in(s(X)) → U3(X, plus_in(X))
plus_in(0) → U2(nat_in)
nat_inU1(nat_in)
nat_innat_out(0)
U1(nat_out(X)) → nat_out(s(X))
U2(nat_out(X)) → plus_out(0, X, X)
U3(X, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, ways_in(Amount, Coins))
ways_in(X, []) → ways_out(X, [], 0)
ways_in(0, X) → ways_out(0, X, s(0))
U10(Amount, C, Coins, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U5(Amount, C, Coins, plus_in(s(C)))
U5(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U6(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N1, ways_in(NewAmount, .(s(C), Coins)))
U7(Amount, C, Coins, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, plus_in(N1))
U8(Amount, C, Coins, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The set Q consists of the following terms:

ways_in(x0, x1)
=_in(x0)
U4(x0, x1, x2, x3)
plus_in(x0)
nat_in
U1(x0)
U2(x0)
U3(x0, x1)
U9(x0, x1, x2, x3)
U10(x0, x1, x2, x3)
U5(x0, x1, x2, x3)
U6(x0, x1, x2, x3, x4)
U7(x0, x1, x2, x3, x4)
U8(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_in(Amount)) at position [3] we obtained the following new rules:

WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_out(Amount, Amount))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
QDP
                            ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

U91(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins)
WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_out(Amount, Amount))
U61(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins))
U41(Amount, C, Coins, =_out(Amount, s(X))) → U91(Amount, C, Coins, plus_in(Amount))
U41(Amount, C, Coins, =_out(Amount, s(X))) → U51(Amount, C, Coins, plus_in(s(C)))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins)) → U4(Amount, C, Coins, =_in(Amount))
=_in(X) → =_out(X, X)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U9(Amount, C, Coins, plus_in(Amount))
plus_in(s(X)) → U3(X, plus_in(X))
plus_in(0) → U2(nat_in)
nat_inU1(nat_in)
nat_innat_out(0)
U1(nat_out(X)) → nat_out(s(X))
U2(nat_out(X)) → plus_out(0, X, X)
U3(X, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, ways_in(Amount, Coins))
ways_in(X, []) → ways_out(X, [], 0)
ways_in(0, X) → ways_out(0, X, s(0))
U10(Amount, C, Coins, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U5(Amount, C, Coins, plus_in(s(C)))
U5(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U6(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N1, ways_in(NewAmount, .(s(C), Coins)))
U7(Amount, C, Coins, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, plus_in(N1))
U8(Amount, C, Coins, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The set Q consists of the following terms:

ways_in(x0, x1)
=_in(x0)
U4(x0, x1, x2, x3)
plus_in(x0)
nat_in
U1(x0)
U2(x0)
U3(x0, x1)
U9(x0, x1, x2, x3)
U10(x0, x1, x2, x3)
U5(x0, x1, x2, x3)
U6(x0, x1, x2, x3, x4)
U7(x0, x1, x2, x3, x4)
U8(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U41(Amount, C, Coins, =_out(Amount, s(X))) → U91(Amount, C, Coins, plus_in(Amount)) we obtained the following new rules:

U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U91(s(x3), z1, z2, plus_in(s(x3)))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
QDP
                                ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U91(s(x3), z1, z2, plus_in(s(x3)))
U91(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins)
U61(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins))
WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_out(Amount, Amount))
U41(Amount, C, Coins, =_out(Amount, s(X))) → U51(Amount, C, Coins, plus_in(s(C)))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins)) → U4(Amount, C, Coins, =_in(Amount))
=_in(X) → =_out(X, X)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U9(Amount, C, Coins, plus_in(Amount))
plus_in(s(X)) → U3(X, plus_in(X))
plus_in(0) → U2(nat_in)
nat_inU1(nat_in)
nat_innat_out(0)
U1(nat_out(X)) → nat_out(s(X))
U2(nat_out(X)) → plus_out(0, X, X)
U3(X, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, ways_in(Amount, Coins))
ways_in(X, []) → ways_out(X, [], 0)
ways_in(0, X) → ways_out(0, X, s(0))
U10(Amount, C, Coins, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U5(Amount, C, Coins, plus_in(s(C)))
U5(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U6(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N1, ways_in(NewAmount, .(s(C), Coins)))
U7(Amount, C, Coins, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, plus_in(N1))
U8(Amount, C, Coins, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The set Q consists of the following terms:

ways_in(x0, x1)
=_in(x0)
U4(x0, x1, x2, x3)
plus_in(x0)
nat_in
U1(x0)
U2(x0)
U3(x0, x1)
U9(x0, x1, x2, x3)
U10(x0, x1, x2, x3)
U5(x0, x1, x2, x3)
U6(x0, x1, x2, x3, x4)
U7(x0, x1, x2, x3, x4)
U8(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U41(Amount, C, Coins, =_out(Amount, s(X))) → U51(Amount, C, Coins, plus_in(s(C))) we obtained the following new rules:

U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U51(s(x3), z1, z2, plus_in(s(z1)))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Instantiation
QDP
                                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U91(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins)
U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U91(s(x3), z1, z2, plus_in(s(x3)))
WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_out(Amount, Amount))
U61(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U51(s(x3), z1, z2, plus_in(s(z1)))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins)

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins)) → U4(Amount, C, Coins, =_in(Amount))
=_in(X) → =_out(X, X)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U9(Amount, C, Coins, plus_in(Amount))
plus_in(s(X)) → U3(X, plus_in(X))
plus_in(0) → U2(nat_in)
nat_inU1(nat_in)
nat_innat_out(0)
U1(nat_out(X)) → nat_out(s(X))
U2(nat_out(X)) → plus_out(0, X, X)
U3(X, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, ways_in(Amount, Coins))
ways_in(X, []) → ways_out(X, [], 0)
ways_in(0, X) → ways_out(0, X, s(0))
U10(Amount, C, Coins, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U5(Amount, C, Coins, plus_in(s(C)))
U5(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U6(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N1, ways_in(NewAmount, .(s(C), Coins)))
U7(Amount, C, Coins, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, plus_in(N1))
U8(Amount, C, Coins, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The set Q consists of the following terms:

ways_in(x0, x1)
=_in(x0)
U4(x0, x1, x2, x3)
plus_in(x0)
nat_in
U1(x0)
U2(x0)
U3(x0, x1)
U9(x0, x1, x2, x3)
U10(x0, x1, x2, x3)
U5(x0, x1, x2, x3)
U6(x0, x1, x2, x3, x4)
U7(x0, x1, x2, x3, x4)
U8(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U91(s(x3), z1, z2, plus_in(s(x3)))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → WAYS_IN(Amount, Coins)
The remaining pairs can at least be oriented weakly.

U91(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins)
WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_out(Amount, Amount))
U61(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U51(s(x3), z1, z2, plus_in(s(z1)))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(=_in(x1)) = 0   
POL(=_out(x1, x2)) = 0   
POL(U1(x1)) = 0   
POL(U10(x1, x2, x3, x4)) = 0   
POL(U2(x1)) = 0   
POL(U3(x1, x2)) = 0   
POL(U4(x1, x2, x3, x4)) = 0   
POL(U41(x1, x2, x3, x4)) = 1 + x3   
POL(U5(x1, x2, x3, x4)) = 0   
POL(U51(x1, x2, x3, x4)) = 1 + x1 + x3   
POL(U6(x1, x2, x3, x4, x5)) = 0   
POL(U61(x1, x2, x3, x4, x5)) = 1 + x3   
POL(U7(x1, x2, x3, x4, x5)) = 0   
POL(U8(x1, x2, x3, x4)) = 0   
POL(U9(x1, x2, x3, x4)) = 0   
POL(U91(x1, x2, x3, x4)) = x3   
POL(WAYS_IN(x1, x2)) = x2   
POL([]) = 0   
POL(nat_in) = 0   
POL(nat_out(x1)) = 0   
POL(plus_in(x1)) = 0   
POL(plus_out(x1, x2, x3)) = 0   
POL(s(x1)) = 0   
POL(ways_in(x1, x2)) = 0   
POL(ways_out(x1, x2, x3)) = 0   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Instantiation
                                  ↳ QDP
                                    ↳ QDPOrderProof
QDP
                                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U91(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → WAYS_IN(Amount, Coins)
U61(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins))
WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_out(Amount, Amount))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U51(s(x3), z1, z2, plus_in(s(z1)))

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins)) → U4(Amount, C, Coins, =_in(Amount))
=_in(X) → =_out(X, X)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U9(Amount, C, Coins, plus_in(Amount))
plus_in(s(X)) → U3(X, plus_in(X))
plus_in(0) → U2(nat_in)
nat_inU1(nat_in)
nat_innat_out(0)
U1(nat_out(X)) → nat_out(s(X))
U2(nat_out(X)) → plus_out(0, X, X)
U3(X, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, ways_in(Amount, Coins))
ways_in(X, []) → ways_out(X, [], 0)
ways_in(0, X) → ways_out(0, X, s(0))
U10(Amount, C, Coins, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U5(Amount, C, Coins, plus_in(s(C)))
U5(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U6(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N1, ways_in(NewAmount, .(s(C), Coins)))
U7(Amount, C, Coins, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, plus_in(N1))
U8(Amount, C, Coins, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The set Q consists of the following terms:

ways_in(x0, x1)
=_in(x0)
U4(x0, x1, x2, x3)
plus_in(x0)
nat_in
U1(x0)
U2(x0)
U3(x0, x1)
U9(x0, x1, x2, x3)
U10(x0, x1, x2, x3)
U5(x0, x1, x2, x3)
U6(x0, x1, x2, x3, x4)
U7(x0, x1, x2, x3, x4)
U8(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Instantiation
                                  ↳ QDP
                                    ↳ QDPOrderProof
                                      ↳ QDP
                                        ↳ DependencyGraphProof
QDP

Q DP problem:
The TRS P consists of the following rules:

WAYS_IN(Amount, .(s(C), Coins)) → U41(Amount, C, Coins, =_out(Amount, Amount))
U61(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → WAYS_IN(NewAmount, .(s(C), Coins))
U51(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U61(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U41(s(x3), z1, z2, =_out(s(x3), s(x3))) → U51(s(x3), z1, z2, plus_in(s(z1)))

The TRS R consists of the following rules:

ways_in(Amount, .(s(C), Coins)) → U4(Amount, C, Coins, =_in(Amount))
=_in(X) → =_out(X, X)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U9(Amount, C, Coins, plus_in(Amount))
plus_in(s(X)) → U3(X, plus_in(X))
plus_in(0) → U2(nat_in)
nat_inU1(nat_in)
nat_innat_out(0)
U1(nat_out(X)) → nat_out(s(X))
U2(nat_out(X)) → plus_out(0, X, X)
U3(X, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U9(Amount, C, Coins, plus_out(Amount, s(X1), s(C))) → U10(Amount, C, Coins, ways_in(Amount, Coins))
ways_in(X, []) → ways_out(X, [], 0)
ways_in(0, X) → ways_out(0, X, s(0))
U10(Amount, C, Coins, ways_out(Amount, Coins, N)) → ways_out(Amount, .(s(C), Coins), N)
U4(Amount, C, Coins, =_out(Amount, s(X))) → U5(Amount, C, Coins, plus_in(s(C)))
U5(Amount, C, Coins, plus_out(s(C), NewAmount, Amount)) → U6(Amount, C, Coins, NewAmount, ways_in(Amount, Coins))
U6(Amount, C, Coins, NewAmount, ways_out(Amount, Coins, N1)) → U7(Amount, C, Coins, N1, ways_in(NewAmount, .(s(C), Coins)))
U7(Amount, C, Coins, N1, ways_out(NewAmount, .(s(C), Coins), N2)) → U8(Amount, C, Coins, plus_in(N1))
U8(Amount, C, Coins, plus_out(N1, N2, N)) → ways_out(Amount, .(s(C), Coins), N)

The set Q consists of the following terms:

ways_in(x0, x1)
=_in(x0)
U4(x0, x1, x2, x3)
plus_in(x0)
nat_in
U1(x0)
U2(x0)
U3(x0, x1)
U9(x0, x1, x2, x3)
U10(x0, x1, x2, x3)
U5(x0, x1, x2, x3)
U6(x0, x1, x2, x3, x4)
U7(x0, x1, x2, x3, x4)
U8(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.